package com.suke.czx.modules.projectType.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.suke.czx.common.utils.R;
import com.suke.czx.modules.projectType.entity.ProjectType;
import com.suke.czx.modules.projectType.mapper.ProjectTypeMapper;
import com.suke.czx.modules.projectType.service.ProjectTypeService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 应用模块名称: 项目类型
 * 代码描述: 项目类业务层
 * copyright: AUZAR ALL RIGHTS RESERVED
 * company: AUZAR
 *
 * @author: 颜米晨
 * @date: 2021/09/06 17:59:05
 */
@Service
@AllArgsConstructor
public class ProjectTypeServiceImpl extends ServiceImpl<ProjectTypeMapper, ProjectType> implements ProjectTypeService {

    private final ProjectTypeMapper projectTypeMapper;

    /**
     * 查询所有项目类型
     * @param projectTypeIds 项目类型ids
     * @return 项目类型数据集
     */
    @Override
    public List<ProjectType> selectProjectType(String projectTypeIds) {
        return projectTypeMapper.selectProjectType(projectTypeIds);
    }

    /**
     * 删除项目类型
     * @param projectTypeId 项目类型编码
     * @param userId 操作者编码
     * @return VO
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R updateDelProjectType(Long projectTypeId, Long userId) {
        projectTypeMapper.updateDelProjectType(projectTypeId, userId);
        return R.ok();
    }

}
